//
//  FindNowPassWordViewController.m
//  cityStar
//
//  Created by joyban on 15-1-14.
//  Copyright (c) 2015年 tiny. All rights reserved.
//

#import "FindNowPassWordViewController.h"
#import "UIColor+FlatUI.h"

@interface FindNowPassWordViewController ()<UITextFieldDelegate>
@property (weak, nonatomic) IBOutlet UITextField *telPhone;
@property (weak, nonatomic) IBOutlet UITextField *NowPassWord;
@property (weak, nonatomic) IBOutlet UITextField *SecendNowPassWord;
@property (strong, nonatomic)  UILabel *label;

@end

@implementation FindNowPassWordViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"";
    
    self.label = [[UILabel alloc]initWithFrame:CGRectMake(100, 32, 120, 20)];
    self.label.font = [UIFont boldSystemFontOfSize:18];
    self.label.textAlignment = NSTextAlignmentCenter;
    self.label.text = @"找回提现密码";
    self.label.textColor = [UIColor colorFromHexCode:@"585858"];
    [self.navigationController.view addSubview:self.label];
    
    [self addBackButton];
    self.telPhone.placeholder = @"手机验证码";
    self.NowPassWord.placeholder = @"请输入新提现密码";
    self.SecendNowPassWord.placeholder = @"请重复输入新提现密码";
    
    self.telPhone.returnKeyType = UIReturnKeyDone;
    self.telPhone.delegate = self;
    self.NowPassWord.returnKeyType = UIReturnKeyDone;
    self.NowPassWord.delegate = self;
    self.SecendNowPassWord.returnKeyType = UIReturnKeyDone;
    self.SecendNowPassWord.delegate = self;
}

-(void)back
{
    [self.label removeFromSuperview];
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    return YES;
}
#pragma - mark textDeletage

-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
    return YES;
}


- (IBAction)Yangzheng_Action:(id)sender
{
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"发送成功" delegate:self cancelButtonTitle:@"确认" otherButtonTitles: nil];
    [alert show];
}

- (IBAction)Return_Action:(id)sender
{
    if([self.telPhone.text isEqualToString:@""])
    {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"验证码不能为空" delegate:self cancelButtonTitle:@"确认" otherButtonTitles: nil];
        [alert show];
    }else if([self.NowPassWord.text isEqualToString:@""])
    {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"新提现密码不能为空" delegate:self cancelButtonTitle:@"确认" otherButtonTitles: nil];
        [alert show];
    }else if ([self.SecendNowPassWord.text isEqualToString:@""])
    {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"再一次输入新提现密码不能为空" delegate:self cancelButtonTitle:@"确认" otherButtonTitles: nil];
        [alert show];
    }else if(![self.NowPassWord.text isEqualToString: self.SecendNowPassWord.text])
    {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"两次输入的提现密码不一致空" delegate:self cancelButtonTitle:@"确认" otherButtonTitles: nil];
        [alert show];
    }else{
        
    }
    
}
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [self.telPhone resignFirstResponder];
    [self.NowPassWord resignFirstResponder];
    [self.SecendNowPassWord resignFirstResponder];
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
